# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

add_executable(pollux_s3config_test S3ConfigTest.cpp)
add_test(pollux_s3config_test pollux_s3config_test)
target_link_libraries(
  pollux_s3config_test
  pollux_common_config
  pollux_s3fs
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3file_test S3FileSystemTest.cpp S3UtilTest.cpp)
add_test(pollux_s3file_test pollux_s3file_test)
target_link_libraries(
  pollux_s3file_test
  pollux_file
  pollux_s3fs
  pollux_core
  pollux_exec_test_lib
  pollux_dwio_common_exception
  pollux_exec
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3registration_test S3FileSystemRegistrationTest.cpp)
add_test(pollux_s3registration_test pollux_s3registration_test)
target_link_libraries(
  pollux_s3registration_test
  pollux_file
  pollux_s3fs
  pollux_core
  pollux_exec_test_lib
  pollux_dwio_parquet_reader
  pollux_dwio_common_exception
  pollux_exec
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3finalize_test S3FileSystemFinalizeTest.cpp)
add_test(pollux_s3finalize_test pollux_s3finalize_test)
target_link_libraries(
  pollux_s3finalize_test
  pollux_s3fs
  pollux_file
  pollux_core
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3insert_test S3InsertTest.cpp)
add_test(pollux_s3insert_test pollux_s3insert_test)
target_link_libraries(
  pollux_s3insert_test
  pollux_file
  pollux_s3fs
  pollux_core
  pollux_exec_test_lib
  pollux_dwio_parquet_writer
  pollux_dwio_parquet_reader
  pollux_dwio_common_exception
  pollux_exec
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3read_test S3ReadTest.cpp)
add_test(
  NAME pollux_s3read_test
  COMMAND pollux_s3read_test
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(
  pollux_s3read_test
  pollux_file
  pollux_s3fs
  pollux_core
  pollux_exec_test_lib
  pollux_dwio_parquet_reader
  pollux_dwio_common_exception
  pollux_exec
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3metrics_test S3FileSystemMetricsTest.cpp)
add_test(pollux_s3metrics_test pollux_s3metrics_test)
target_link_libraries(
  pollux_s3metrics_test
  pollux_s3fs
  pollux_exec_test_lib
  GTest::gtest
  GTest::gtest_main)

add_executable(pollux_s3multiendpoints_test S3MultipleEndpointsTest.cpp)
add_test(pollux_s3multiendpoints_test pollux_s3multiendpoints_test)
target_link_libraries(
  pollux_s3multiendpoints_test
  pollux_file
  pollux_s3fs
  pollux_core
  pollux_exec_test_lib
  pollux_dwio_parquet_reader
  pollux_dwio_parquet_writer
  pollux_dwio_common_exception
  pollux_exec
  GTest::gtest
  GTest::gtest_main)
